package cn.zr.aitool.model;

import android.text.TextUtils;

import java.util.ArrayList;

import cn.zr.aitool.bean.ContentBean;

/**
 * 文件名称:
 * 功能描述:
 * 创建者: zhengrui
 * 创建时间: 2018/8/28
 * 修改者: zhengrui
 * Copyright (C) 2017 猎户星空
 *
 * @author zhengrui
 */
public class JiJinImpl extends BaseContentModal {
    public JiJinImpl(ContentBean mBean) {
        super(mBean);
    }

    @Override
    public ArrayList<String> getContentHint() {
        ArrayList<String> hints = new ArrayList<>();
        hints.add("名称");
        hints.add("渠道");
        hints.add("金额");
        hints.add("类型");
        return hints;
    }

    @Override
    public String getDescribeByType() {
        return "定投";
    }

    public int getCost() {
        if (!TextUtils.isEmpty(mBean.content)) {
            String[] temps = mBean.content.split(":");
            try {
                return Integer.valueOf(temps[1]);
            } catch (Exception e) {

            }
        }
        return 0;
    }

    public int getRevenue() {
        if (!TextUtils.isEmpty(mBean.content2)) {
            String[] temps = mBean.content2.split(":");
            try {
                return Integer.valueOf(temps[1]);
            } catch (Exception e) {

            }
        }
        return 0;
    }
}
